﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using MementoWeb.Controllers;
using MementoWeb.Models;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

namespace MementoWeb.Tests.Controllers
{
    [TestClass]
    public class WorkLogReportControllerTest
    {
        private Mock<IDataRepository> _dataRepository;
        
        [TestInitialize]
        public void Setup()
        {
            _dataRepository = new Mock<IDataRepository>();
                            
        }

        [TestMethod]
        public void GetWorkLogReport()
        {
            // Arrange
            _dataRepository.Setup(r => r.ReportWorkLoggedByCategory(It.IsAny<DateTime>(), It.IsAny<DateTime>(), It.IsAny<int>(), It.IsAny<int>())).Returns(new List<WorkLogReportItem>(){});
            var controller = new WorkLogReportController(_dataRepository.Object);

            // Act
            controller.Get(DateTime.Now.AddYears(-5), DateTime.Now.AddYears(5), 1, 1);

            // Assert
            _dataRepository.VerifyAll();

        }
    }
}
